/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.ibrae.mchs.radiation.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author murr
 */
@Embeddable
public class CrossZonPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "ID_NP", nullable = false)
    private int idNp;
    @Basic(optional = false)
    @Column(name = "ID_ZON", nullable = false)
    private int idZon;
    @Basic(optional = false)
    @Column(name = "DATE_ZON0", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateZon0;

    public CrossZonPK() {
    }

    public CrossZonPK(int idNp, int idZon, Date dateZon0) {
        this.idNp = idNp;
        this.idZon = idZon;
        this.dateZon0 = dateZon0;
    }

    public int getIdNp() {
        return idNp;
    }

    public void setIdNp(int idNp) {
        this.idNp = idNp;
    }

    public int getIdZon() {
        return idZon;
    }

    public void setIdZon(int idZon) {
        this.idZon = idZon;
    }

    public Date getDateZon0() {
        return dateZon0;
    }

    public void setDateZon0(Date dateZon0) {
        this.dateZon0 = dateZon0;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idNp;
        hash += (int) idZon;
        hash += (dateZon0 != null ? dateZon0.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CrossZonPK)) {
            return false;
        }
        CrossZonPK other = (CrossZonPK) object;
        if (this.idNp != other.idNp) {
            return false;
        }
        if (this.idZon != other.idZon) {
            return false;
        }
        if ((this.dateZon0 == null && other.dateZon0 != null) || (this.dateZon0 != null && !this.dateZon0.equals(other.dateZon0))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "JPAtest.entities.CrossZonPK[idNp=" + idNp + ", idZon=" + idZon + ", dateZon0=" + dateZon0 + "]";
    }

}
